/**
 * 
 */
package br.com.ac.fatureweb.model.carga;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import br.com.ac.fatureweb.integration.model.OcorrenciaVO.EnumTypeCobranca;
import br.com.ac.fatureweb.model.Carga;
import br.com.ac.fatureweb.utilitary.Model;

/**
 * @author aldivone
 *
 */
@Entity
@Table(name = "OCORRENCIA")
@SequenceGenerator(name = "SEQ_OCORRENCIA", sequenceName = "SEQ_OCORRENCIA", allocationSize = 1, initialValue = 1)
public class Ocorrencia extends Model {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4628026854114371098L;

	@Id
	@GeneratedValue(generator = "SEQ_OCORRENCIA", strategy = GenerationType.SEQUENCE)
	@Column(name = "ID")
	private Long id;

	@Column(name = "CODIGO")
	private Long codigo;

	@Column(name = "DESCRICAO")
	private String descricao;

	@Column(name = "FLG_OCORRENCIA")
	private boolean flgOcorrencia;

	@Column(name = "FLG_TIPOCOBRANCA")
	@Enumerated(EnumType.ORDINAL)
	private EnumTypeCobranca flgTipoCobranca;

	@Column(name = "FLG_EMITIRCONTA")
	private boolean flgEmitirConta;

	@ManyToOne
	@JoinColumn(name = "ID_CARGA", referencedColumnName = "ID")
	private Carga carga;

	public Ocorrencia() {
		super();
	}

	public Ocorrencia(Long id) {
		super();
		this.id = id;
	}

	public Ocorrencia(Long id, Long codigo, String descricao,
			boolean flgOcorrencia, EnumTypeCobranca flgTipoCobranca,
			boolean flgEmitirConta, Carga carga) {
		super();
		this.id = id;
		this.codigo = codigo;
		this.descricao = descricao;
		this.flgOcorrencia = flgOcorrencia;
		this.flgTipoCobranca = flgTipoCobranca;
		this.flgEmitirConta = flgEmitirConta;
		this.carga = carga;
	}

	/**
	 * @return the carga
	 */
	public Carga getCarga() {
		return carga;
	}

	/**
	 * @param carga
	 *            the carga to set
	 */
	public void setCarga(Carga carga) {
		this.carga = carga;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the codigo
	 */
	public Long getCodigo() {
		return codigo;
	}

	/**
	 * @param codigo
	 *            the codigo to set
	 */
	public void setCodigo(Long codigo) {
		this.codigo = codigo;
	}

	/**
	 * @return the descricao
	 */
	public String getDescricao() {
		return descricao;
	}

	/**
	 * @param descricao
	 *            the descricao to set
	 */
	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	/**
	 * @return the flgOcorrencia
	 */
	public boolean isFlgOcorrencia() {
		return flgOcorrencia;
	}

	/**
	 * @param flgOcorrencia
	 *            the flgOcorrencia to set
	 */
	public void setFlgOcorrencia(boolean flgOcorrencia) {
		this.flgOcorrencia = flgOcorrencia;
	}

	/**
	 * @return the flgTipoCobranca
	 */
	public EnumTypeCobranca getFlgTipoCobranca() {
		return flgTipoCobranca;
	}

	/**
	 * @param flgTipoCobranca
	 *            the flgTipoCobranca to set
	 */
	public void setFlgTipoCobranca(EnumTypeCobranca flgTipoCobranca) {
		this.flgTipoCobranca = flgTipoCobranca;
	}

	/**
	 * @return the flgEmitirConta
	 */
	public boolean isFlgEmitirConta() {
		return flgEmitirConta;
	}

	/**
	 * @param flgEmitirConta
	 *            the flgEmitirConta to set
	 */
	public void setFlgEmitirConta(boolean flgEmitirConta) {
		this.flgEmitirConta = flgEmitirConta;
	}

}
